package com.github.zyflzz.mycalculator.core;

/**
 * @author created by zyf on 2023/3/21
 **/
public enum Operation {
    ADD(1, "+", "+ "),
    MINUS(1, "-", "- "),
    TIMES(2, "*", "* "),
    DIV(2, "/", "/ "),
    POW(3, "^", "^ "),
    LB(4, "(", "( "),
    RB(4, ")", ") "),
    SIN(5, "sin", "( sin ( "),
    COS(5, "cos", "( cos ( "),
    TAN(5, "tan", "( tan ( "),
    LN(5, "ln", "( ln ( "),
    LG(5, "lg", "( lg ( "),
    SQRT(5, "sqrt", "( sqrt ( "),
    PI(5, "pi", "pi "),
    E(5, "e", "e "),
    DEG(5, "°", "° "),
    FRAC(5, "!", "! "),
    PERC(5, "%", "% "),
    RECI(5, "1/x", "( 1 / "),
    NONE(0, "", " "),

    // 2nd

    ASIN(5, "asin", "( asin ( "), // sin -> asin
    ACOS(5, "acos", "( acos ( "), // cos -> acos
    ATAN(5, "atan", "( atan ( "), // tan -> atan
    EXP(5, "exp", "( exp ( "), // deg -> exp
    SINH(5, "sinh", "( sinh ( "), // pow -> asin
    COSH(5, "cosh", "( cosh ( "), // lg -> acos
    TANH(5, "tanh", "( tanh ( "), // ln -> atan
    SQUARE(5, "squ", "( squ ( "), // sqrt -> squ
    GAMMA(5, "Γ", "( Γ ( "), // frac -> gamma
    CATALAN(5, "G", "G "), // reci -> G
    EM(5, "γ", "γ  "), // pi -> em

    ;



    private final Integer priority;
    private final String symbol;
    private final String text;

    Operation(Integer priority, String symbol, String text) {
        this.priority = priority;
        this.symbol = symbol;
        this.text = text;
    }

    public Integer getPriority() {
        return priority;
    }

    public String getSymbol() {
        return symbol;
    }

    public String getText() {
        return text;
    }
}
